<?php
declare(strict_types=1);

use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;

final class AddColumnIndexInAttributeValueTable extends AbstractMigration
{
    public function up()
    {
        $this->table('attribute_value')
            ->addColumn('index', 'integer', ['signed' => false, 'default' => 0, 'limit' => MysqlAdapter::INT_SMALL, 'comment' => '顺序id'])
            ->save();
    }

    public function down()
    {
        $this->table('attribute_value')
            ->removeColumn('index')
            ->save();
    }
}
